<template>
<div> 
  <div class="banner" @click="OpenGallary">
     <img class="banner-img" :src="this.bannerImg" />
     <div class="banner-info">
  	   <div class="banner-title">{{this.sightName}}</div>
  	   <div class="banner-number"><span class="iconfont books">&#xeb66;</span>{{this.vNumber}}</div>
     </div>
  </div>  
  <fade-animateion>
     <common-gallary v-show="ShowGallary" @ClickHide="ClickHide" :imgs="this.gallaryImgs"></common-gallary>
  </fade-animateion>
</div>
</template>
<script>
import CommonGallary from 'common/gallary/Gallary'
import FadeAnimateion from 'common/fade/FadeAnimate'
export default {
  name: 'Banner',
  components: {
    CommonGallary,
    FadeAnimateion
  },
  props:{
    sightName:String,
    bannerImg:String,
    vNumber:String,
    gallaryImgs:Array
  },
  data() {
    return {
      ShowGallary:false,
      imgs:[]
    }
  },
  methods:{
    OpenGallary () {
      this.ShowGallary = true
    },
    ClickHide () {
      this.ShowGallary = false
    },
    Setdata () {
      const list = JSON.parse(localStorage.imgs);
      for(var i = 0; i < list.length; i++){
        this.imgs[i] = list[i];
      }
    }
  },
  mounted() {
    this.Setdata()
  }
}
</script>
<style lang="stylus" scoped> 
  .banner
    overflow:hidden
    height:0
    padding-bottom:55%
    position:relative
    .banner-img
      width:100%
    .banner-info    
      position:absolute
      bottom:0
      left:0     
      right:0
      color:#fff
      font-size:12px
      line-height:0.45rem
      padding:0 .1rem
      z-index:99
      display:flex
      background-image:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.8))
      .banner-title
        flex:1
      .banner-number
        background:rgba(0,0,0,0.6)
        padding:0.02rem 0.1rem
        font-size:0.23rem
        height:0.32rem
        line-height:0.32rem
        border-radius:.2rem
        .books
          font-size:0.1rem
          margin-right:0.08rem
</style>